// <<<<<<< HEAD
const ProviderDao=require("../../dao/provider/provider_dao.js");
// =======
// const ProviderDao=require("../../dao/provider/provider_dao.js")
// >>>>>>> 79c9b497f3c65895301f80ba782aa12597a0c8a1


const ProviderService={
	//添加供应商信息

	add(req,res,next){
		//获取post请求中传递的数据
       const{provider,username,number,address,fax,time}=req.body;
       
       //保存数据到数据库中
       ProviderDao.save({provider,username,number,address,fax,time})
                .then((data)=>{
                	res.json({
                		res_code:1,
                		res_error:"",
                		res_body:{
                			status:1,
                			data:data
                		}
                	});
                })
                .catch((err)=>{
                	res.json({
                		res_code:0,
                		res_error:err,
                		res_body:{}
                	})
                });
	},
   
};

module.exports=ProviderService;